# 线程池
from concurrent.futures import ThreadPoolExecutor
# 进程池
from concurrent.futures import ProcessPoolExecutor

def fn(name):
    for i in range(100):
        print(name, i)

if __name__ == '__main__':
    with ThreadPoolExecutor(50) as t:
        for i in range(100):
            t.submit(fn, name=f'线程{i}')

    # 线程池执行完成后才继续执行
    print('done')